package cn.tony.game.super_tank;

import java.awt.Color;
import java.awt.Graphics;

public class Zidan extends Drawable {

	int speed = 6;
	int cell = 5;

	public Zidan() {
		w = h = cell;
	}

	@Override
	public void syncLocation(Drawable relative) {
		this.team = relative.team;
		this.dir = this.oDir = relative.checkDir();
		this.x = relative.x + relative.w / 2;
		this.y = relative.y + relative.h / 2;
	}

	@Override
	public void draw(Graphics g) {
		if (!isAlive) {
			return;
		}
		move(dir, speed);
		g.setColor(Color.red);
		g.fillOval(x, y, w, h);
	}

}
